import { loginApi } from '@/api/user'
const state = {
  token: null,
  gdDetial: {}
}
const mutations = {
  setToken (state, token) {
    state.token = token
  },
  removeToken (state) {
    state.token = null
  },
  setGddetial (state, gddetial) {
    state.gdDetial = gddetial
    // console.log(gddetial)
  },
  removeGddetial (state) {
    state.gdDetial = {}
  }
}
const actions = {
  async loginAction ({ commit }, data) {
    const res = await loginApi(data)
    // console.log(res)
    commit('setToken', res)
  }

}
export default {
  namespaced: true,
  state,
  mutations,
  actions
}
